import userConfig from '../../config/userConfig';

const API_VERSION = "v2";
const URL_PRE = "/" + API_VERSION;
const baseUrl = location.protocol + "//" + location.host + URL_PRE;

const UrlConst = {
    notify: {
        icon: `${userConfig.baseUrl}res/okex/img/logo_okex_v2.png`,
        sound: `${userConfig.baseUrl}res/okex/sound/qq-notify.mp3`,
    },
    spot: {
        LOG_RECORD: "/logRecord",
        POST_COLLECT_PRODUCT: baseUrl + "/spot/new-collect/edit",
        GET_INDEX_TICKER: baseUrl + "/futures/market/indexTicker?symbol=f_usd_{0}",
        GET_IS_TRADEPWD: baseUrl + "/spot/config/is-need-trade-pwd",
        GET_PRODUCT_LIST: baseUrl + "/spot/new-collect",
        GET_CURRENCY: baseUrl + "/spot/markets/currencies",
        GET_ASSETS: baseUrl + "/spot/accounts/by-currency",
        GET_TICKERS: baseUrl + "/spot/markets/tickers",
        GET_DEPTH: baseUrl + "/spot/markets/deep-deal?symbol={0}",
        GET_UNSETTLEMENT: baseUrl + "/spot/order/unsettlement",
        GET_ORDER_HISTORY: baseUrl + "/spot/order/history",
        GET_ENTRUST_PLAN: baseUrl + "/spot/plan/recent",
        GET_HISTORY_ENTRUST: baseUrl + "/spot/plan/history",
        POST_SUBMIT_ORDER: baseUrl + "/spot/order/add?symbol={0}",
        POST_SUBMIT_PlAN_ORDER: baseUrl + "/spot/plan/add-entrust",
        POST_CANCEL_ORDER: baseUrl + "/spot/order/cancel?symbol={0}&orderId={1}",
        DELETE_CANCEL_ENTRUST: baseUrl + "/spot/plan/cancel?id={1}&symbol={0}",
        POST_CANCELALL_ORDER: baseUrl + "/spot/order/cancel-all?symbol={0}&systemType={1}",
        GET_CALLMARKET_BYID: baseUrl + "/spot/markets/call-auction?productId={0}",
        GET_KLINE_DATA: baseUrl + "/spot/markets/kline?size=300&symbol={0}&type={1}",
        GET_FULLKLINE_DATA: baseUrl + "/spot/markets/kline?since=0&symbol={0}",
        GET_DEALS: baseUrl + "/spot/markets/deals?symbol={0}",
        GET_MARGIN_HISTORY_ORDER: baseUrl + "/spot/margin/borrow-order/borrows",
        GET_BILLS: baseUrl + "/spot/bills/bills",
        GET_BILLS_TYPE: baseUrl + "/spot/bills/types",
        GET_MARGIN_BILLS: baseUrl + "/spot/margin/bills",
        GET_MARGIN_BILLS_TYPE: baseUrl + "/spot/margin/bills/types",
        POST_SUBMIT_AGREEMENT: baseUrl + "/spot/margin/settings/status",
        GET_USER_MARGIN_SETTING: baseUrl + "/spot/margin/settings/status",
        GET_LOAN_MAX_LIMIT: baseUrl + "/spot/margin/accounts/max-loan-limit",
        POST_SUBMIT_LOAN: baseUrl + "/spot/margin/accounts/loan",
        POST_SUBMIT_REPAYMENT: baseUrl + "/spot/margin/accounts/repayment",
        GET_MARGIN_ACCOUNT: baseUrl + "/spot/margin/accounts",
        GET_MARGIN_ACCOUNT_BYPRODUCT: baseUrl + "/spot/margin/accounts/{0}",
        GET_ONE_MERGETYPES: baseUrl + "/spot/merge/coin-deep-level-data",
        GET_INTRODUCE: baseUrl + "/spot/markets/currency/describe?currency={0}",
        DOWNLOAD_BILLS: baseUrl + "/spot/bills/download-bills"
    },
    c2c: {
        GET_PRODUCT_LIST: URL_PRE + "/c2c-open/currencies/group",
        GET_TRADING_ORDER: URL_PRE + "/c2c-open/tradingOrders/group",
        GET_USER_PHONE: URL_PRE + "/c2c-open/user/phone",
        GET_OPEN_USER_KYC: URL_PRE + "/c2c-open/user/kyc",
        POST_TRADING_ORDER: URL_PRE + "/c2c-open/tradingOrder",
        GET_MY_ORDERS: URL_PRE + "/c2c-open/tradingOrders/my",
        GET_USER_ASSET: URL_PRE + "/c2c-open/balance/{0}",
        POST_CANCEL_MY_ORDER: URL_PRE + "/c2c-open/tradingOrder/{0}/cancel",
        POST_OPEN_ORDER: URL_PRE + "/c2c-open/order",
        GET_OPEN_ORDER_LIST: URL_PRE + "/c2c-open/orders",
        POST_OPEN_CONFIRM_PAYMENT: URL_PRE + "/c2c-open/order/{0}/payment-paid",
        POST_OPEN_CONFIRM_RECEIPT: URL_PRE + "/c2c-open/order/{0}/payment-confirmed",
        POST_CHANGE_ORDER_ACCEPTOR: URL_PRE + "/c2c-open/tradingOrder/accept-order",
        GET_CURRENCY_PLATFORM_FEE: URL_PRE + "/c2c-open/currency/{0}",
        POST_CONTACT_EACH_OTHER: URL_PRE + "/c2c-open/order/privacy-number/{0}",
        POST_CHANGE_CONTACT_NUMBER: URL_PRE + "/c2c-open/order/refresh-privacy-number/{0}",
        GET_INDEX_TICKER: URL_PRE + "/market/index/ticker?symbol=f_usd_{0}",
        GET_INDEX_KLINE: URL_PRE + "/market/index/kLine?symbol=f_usd_{0}&type=1min&limit=300&since=0",
        GET_OPEN_ORDER_DETAIL: URL_PRE + "/c2c-open/order/{0}",
        POST_FROZEN_TRADE_ORDER: URL_PRE + "/c2c-open/order/{0}/payment-rejected",
        POST_CANCEL_ORDER: URL_PRE + "/c2c-open/order/{0}/cancel",
        GET_FIRST_ENTRANCE: URL_PRE + "/c2c/first-entrance",
        POST_UPDATE_FIRST_ENTRANCE: URL_PRE + "/c2c/entrance",
        GET_ORDER_DETAIL: URL_PRE + "/c2c/order/{0}",
        POST_INDEX_CONFIRM_PAYMENT: URL_PRE + "/c2c/order/{0}/payment-paid",
        POST_INDEX_CONFIRM_RECEIPT: URL_PRE + "/c2c/order/{0}/payment-confirmed",
        POST_INDEX_CONTACT_EACH_OTHER: URL_PRE + "/c2c/order/privacy-number/{0}",
        POST_INDEX_CHANGE_CONTACT_NUMBER: URL_PRE + "/c2c/order/refresh-privacy-number/{0}",
        POST_INDEX_FROZEN_TRADE_ORDER: URL_PRE + "/c2c/order/{0}/payment-rejected",
        POST_INDEX_CANCEL_ORDER: URL_PRE + "/c2c/order/{0}/cancel",
        GET_INDEX_SYMBOL_LIST: URL_PRE + "/c2c/currencies",
        GET_INDEX_USER_ASSET: URL_PRE + "/c2c/balance/{0}",
        POST_SUBMIT_TRANSFACTION: URL_PRE + "/c2c/order",
        GET_INDEX_USER_KYC: URL_PRE + "/c2c/user/kyc",
        GET_SIMPLE_ORDER: URL_PRE + "/c2c/order/{0}/simple",
        GET_INDEX_ORDER_LIST: URL_PRE + "/c2c/orders",
        GET_ENTER_RECEIVING_PERMISSION: URL_PRE + "/c2c/user/current",
        GET_ACCEPT_ORDER_STATUS: URL_PRE + "/c2c/currencies/accept-order-status",
        POST_CHANGE_ORDER_STATUS: URL_PRE + "/c2c/currency/{0}/accept-order-status",
        GET_CURRENCY_SYMBOL_LIST: URL_PRE + "/c2c/wallet-digital-info",
        GET_WALLER_NATIVE_SYMBOL_INFO: URL_PRE + "/c2c/wallet-legal-info/{0}",
        POST_UPDATE_BALANCE: URL_PRE + "/c2c/balance",
        GET_ALL_CURRENCY: URL_PRE + "/c2c/currencies",
        POST_CHANGE_RECEIPT_MONEY_WAY: URL_PRE + "/c2c/receipt/{0}/status",
        GET_WALLET_HISTORYS: URL_PRE + "/c2c/wallet-historys/{0}/{1}",
        POST_UPLOAD_IMG: URL_PRE + "/c2c-open/oss-upload"
    }
};

export default UrlConst;